home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / CFUNCTS.LZH / PEEK.C < prev    next >
Text File  |  1987-01-22  |  1KB  |  36 lines

  1.      /*
  2.      ===================================================================
  3.                      P E E K   F U N C T I O N
  4.      ===================================================================
  5.      This function will peek a value from a screen memory
  6.      location. It is passed the row and column of the
  7.      desired location to peek. It will then calculate the
  8.      address of the screen location and then return the
  9.      value at that address.
  10.      -----------------------------------------------------------------*/
  11.      char peek(row,col)
  12.      int row, col;
  13.      {
  14.      char far *loc;               /* memory location pointer.         */
  15.      int card_type;               /* card type?                       */
  16.      int position;                /* cursor position.                 */
  17.  
  18.           card_type = card();
  19.           if(card_type == 1){     /* IBM Color Card.                  */
  20.             loc = (char far *)0xb8000000;
  21.           }
  22.           else{                   /* Monochrome card.                 */
  23.             loc = (char far *)0xb0000000;
  24.           }
  25.  
  26.                                   /* Determine cursor position.       */
  27.           position = ((row * 80) + col) * 2;
  28.  
  29.                                   /* Add position to loc.             */
  30.           loc += position;
  31.  
  32.           return(*loc);           /* return value at loc.             */
  33.      }
  34.      /*---------------------------------------------------------------*/
  35.  
  36.